#include"define.hpp"
#include"shm.hpp"
#include"fifo.hpp"
int main(){
    shm sm(pathname,projid,CREATER);
    struct shmid_ds ds;
    //测试IPC_STAT：
    // sm.getdata(&ds);
    // cout<<ds.shm_segsz<<endl;
    // cout<<ds.shm_atime<<endl;
    // 测试IPC_SET(只能修改perm):
    // ds.shm_perm.mode=0006;
    // sm.modifyshm(&ds);
    // sleep(4);




    cnpipe cp(".","ff");
    oppipe op(".","ff");
    op.openr();
    char*as=(char *)sm.address();
    while(1){
        if(op.wait_client()){
            printf("%s",as);
        }
        else break;
    }
    op.Close();

    return 0;
}